package com.general.framework.core.exception;

/**
 * @author leejean
 * ViolationException
 * 验证异常信息类，所有跟业务验证有关的异常信息都应该抛出此异常
 * @date 2020年05月20 10:24:56
 */
public class ViolationException extends BaseException {

    public ViolationException(Throwable cause) {
        super(cause);
    }

    public ViolationException(String message) {
        super(message);
    }

    public ViolationException(final String message, final Throwable cause) {
        super(message, cause);
        this.code = getDefaultCode();
    }

    public ViolationException(final ICode errorCode) {
        super(errorCode);
    }

    public ViolationException(Integer code, String message) {
        super(code, message);
    }

    public ViolationException(Integer code, String message, Throwable cause) {
        super(code, message, cause);
    }

    @Override
    public Integer getDefaultCode() {
        return CodeEnum.VIOLATION_ERROR.getCode();
    }
}

